﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using HalconDotNet;

namespace ImageControl
{
    /// <summary>
    /// HImageShow.xaml 的交互逻辑
    /// </summary>
    public partial class HImageShow : UserControl
    {
        private WindowCtrl hCtrl = null;
        public HImageShow()
        {
            InitializeComponent();
            hCtrl = new WindowCtrl(this);
            this.DataContext = hCtrl;
            this.imageWnd.HInitWindow += HWnd_HInitWindow;

        }
        public WindowCtrl WindowCtrl => hCtrl;
        public HSmartWindowControlWPF SmartCtrlWPF => this.imageWnd;
        public IntPtr HalconId => this.imageWnd.HalconID;
        public HWindow HalconWnd => this.imageWnd.HalconWindow;

        private void HWnd_HInitWindow(object sender, EventArgs e)
        {
        }

        public void AddImage(HWndImage wndImage)
        {
            hCtrl.AddImage(wndImage);
        }

        public void AddObject(HWndObject wndOjbect)
        {
            hCtrl.AddObject(wndOjbect);
        }

        public void AddText(HWndMessage msg)
        {
            hCtrl.AddText(msg);
        }

        public void Repaint()
        {
            hCtrl.Repaint();
        }
        public void FitImageWindow()
        {
            hCtrl.FitImageWindow();
        }
    }
}
